package com.foreverwin.mes.meapi.service.impl;

import com.foreverwin.mes.core.base.FrontPage;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.foreverwin.mes.meapi.model.ReasonCode;
import com.foreverwin.mes.meapi.mapper.ReasonCodeMapper;
import com.foreverwin.mes.meapi.service.ReasonCodeService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Ervin Chen
 * @since 2020-02-18
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ReasonCodeServiceImpl extends ServiceImpl<ReasonCodeMapper, ReasonCode> implements ReasonCodeService {


    @Autowired
    private ReasonCodeMapper reasonCodeMapper;

    @Override
    public Page<ReasonCode> selectPage(FrontPage<ReasonCode> frontPage, ReasonCode reasonCode) {
        EntityWrapper<ReasonCode> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(reasonCode);
        return super.selectPage(frontPage.getPagePlus(), queryWrapper);
    }

    @Override
    public List<ReasonCode> selectList(ReasonCode reasonCode) {
        EntityWrapper<ReasonCode> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(reasonCode);
        return super.selectList(queryWrapper);
    }


}